#from PyQt5.QtWidgets import QGraphicsScene
import pyqtgraph as pg
import numpy as np
from PyQt5.QtWidgets import QApplication,QWidget

import sys



# def pg_plot():
#     app = pg.QtGui.QApplication([])
#     pg.plot(x,title='州的先生zmister.com PyQtGraph教程 - plot()方法')
#     app.exec_()
#pg_plot()

class Mainwindow(QWidget):
    def __init__(self):
        super().__init__()
        #self.pg_windows_addplot()


        self.pg_addplot()
    def pg_addplot(self):
        hbox = self.QHBoxLayout()
        self.plot = pg.PlotWidget(enableAutoRange=True)

        self.curve = self.plot.plot()
        self.curve.setData([1,2,3])



    def pg_windows_addplot(self):
        x = np.random.random(50)
        a = np.random.random(50)
        win = pg.GraphicsLayoutWidget(title="州的先生zmister.com PyQtGraph教程",show=True)
        plot = win.addPlot(title='窗口绘制图形')
        plot.plot(x,a)
        pg.QtGui.QApplication.exec_()




if __name__=='__main__':
    app=QApplication(sys.argv)
    window=Mainwindow()
    #window.show()
    sys.exit(app.exec_())



